/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 98152
 * Date: 2024-07-06
 * Time: 15:00
 */
public class TestDemo1 {
    public static void main(String[] args) {
        Move(3, 'A','B','C');
    }
    public static void Print(char start, char end){
        System.out.print(start +"->"+end+" ");
    }
    public static void Move(int n, char start, char temp, char end){
        if(n == 1){
            Print(start, end);
        }
        else {
            Move(n-1, start, end, temp);
            Print(start, end);
            Move(n-1, temp, start, end);
        }
    }
}
